home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / util / sys / AllocFrags.readme < prev    next >
Text File  |  2000-01-02  |  5KB  |  109 lines

  1. Short:    Get rid of tiny frags from your memory list (+src)
  2. Author:   bernie@cosmos.it (Bernardo Innocenti)
  3. Uploader: bernie@cosmos.it (Bernardo Innocenti)
  4. Version:  1.2
  5. Type:     util/sys
  6. Replaces: util/boot/AllocFrags.lha
  7.  
  8.  
  9. DO YOU HAVE A PROBLEM?
  10. ----------------------
  11.  
  12.  Use the included AvailFrag and FragMeter programs or a system monitor
  13. such as Scout or XOper to determine if your system memory list has
  14. many small holes of 8 to 256 bytes each. Lots of small chunks are
  15. usually made by badly written programs (not freeing all the memory
  16. they allocated).
  17.  
  18.  
  19. WHY IS THAT BAD?
  20. ----------------
  21.  
  22.  A memory list containing hundereds of small nodes slows down the
  23. system because each time AllocMem() or FreeMem() get called
  24. (which happens VERY frequently) the memory list must be scanned
  25. until a suitable chunk is found.
  26.  
  27.  
  28. WHO IS CAUSING IT?
  29. ------------------
  30.  
  31.  On systems equipped with 68040 or 68060 the program SetPatch will
  32. load the 68060.library  68040.library at boot time. These libraries
  33. will setup the MMU page descriptors to cover all addressable memory
  34. space, including space reserved by Zorro boards. Unfortunately, the
  35. 040/060 MMUs requires an 512-byte alignament for the page descriptors,
  36. even if they take up just 256 bytes. So the libraries free up the
  37. remaining 256 bytes in order to give some memory back to the system.
  38. On my Amiga 4000, fitted with four Zorro boards, this creates more
  39. than 500 memory chunks right after booting the system! Such a
  40. fragmented memory list will slow down all AllocMem() and FreeMem()
  41. calls as they need to scan almost the entire list before they can
  42. reach the first memory chunk bigger than 256 byte. You can test
  43. the impact of the memory list fragmentation on your system by
  44. copying a very big file to RAM: before and after SetPatch.
  45.  
  46.  
  47. IS THERE A SOLUTION?
  48. --------------------
  49.  
  50.  Luckly, the 68040/68060 library that comes with the nice
  51. mmu.library package by Thomas Richter is not affected by the problem
  52. desribed above. Also the V44 version of the 68040.library which is
  53. distributed with AmigaOS 3.5 has been fixed not to create so many
  54. small holes in the memory list.
  55.  
  56.  
  57. WHAT ELSE IS CAUSING PROLEMS?
  58. -----------------------------
  59.  
  60.  Even with these new 68040 libraries, many Amiga systems (my own
  61. included) are still suffering by lots of 8 bytes chunks in the memory
  62. list. On my system, I have over 100 frags after booting, and they
  63. grow up to 200-300 when the system runs for some time. I still don't
  64. know exactly what is causing this. The CatchFrags program installs
  65. a patch to AllocMem() and FreeMem() to detect programs allocating
  66. small memory chunks and report them on the debug console. Using it
  67. I noticed that the input.device does many allocations of 8 bytes,
  68. freeing them in a suspicious order. If you're clever enough, please
  69. try to discover why it does so and if it can be patched to work
  70. differently.
  71.  
  72.  
  73. WHAT ELSE CAN YOU DO?
  74. ---------------------
  75.  
  76.  If your system is still affected by this problem, put AllocFrags
  77. anywhere in your Startup-Sequence, after SetPatch. It will remove from
  78. the memory list any chunks whose size is equal or smaller than 256 bytes.
  79. Using AllocFrags frequently during your normal system activity is not
  80. a good idea since it might cause even more fragmentation in your memory
  81. list once you close a program and it frees a memory block which was
  82. contiguous to one already removed by AllocFrags.
  83.  
  84.  I admit AllocFrags is a real hack and it WILL stop working when
  85. the OS memory allocation engine is changed (e.g.: to accomodate
  86. virtual or protected memory). Anyway, I'm sure that AllocFrags will
  87. not cause any incompatibilities or system crashes on the current
  88. OS versions upto OS 3.5. Inspect the source code if you don't
  89. believe me.
  90.  
  91.  
  92. ============================= Archive contents =============================
  93.  
  94. Original  Packed Ratio    Date     Time    Name
  95. -------- ------- ----- --------- --------  -------------
  96.      284     271  4.5% 17-Oct-99 23:19:12 +AllocFrags
  97.     1677     773 53.9% 17-Oct-99 23:05:10 +AllocFrags.c
  98.     3722    1795 51.7% 06-Dec-99 00:10:58 +AllocFrags.readme
  99.      970     446 54.0% 12-Oct-97 00:28:30 +AllocFrags.¶
  100.      932     648 30.4% 30-Jan-97 21:46:40 +AvailFrag
  101.      596     415 30.3% 18-Oct-99 22:25:32 +CatchFrags
  102.     2398     816 65.9% 18-Oct-99 22:25:14 +CatchFrags.c
  103.     8918    2655 70.2% 17-Oct-99 22:16:18 +CompilerSpecific.h
  104.     5932    3947 33.4% 10-Oct-99 15:36:02 +FragMeter
  105.      434     229 47.2% 17-Oct-99 22:59:50 +SCOPTIONS
  106.      285     165 42.1% 17-Oct-99 23:06:58 +SMakefile
  107. -------- ------- ----- --------- --------
  108.    26148   12160 53.4% 06-Dec-99 18:18:32   11 files
  109.